﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using PPI.General;
using PPI.WebConsumer.PPI.Svc;

namespace PPI.WebConsumer.Inspection
{
    public class WInspectionResult
    {
        public static Int32 Save(Int32 inspectionResultId, Int32 InspectionFk, Int32 typeFk, Int32 resultTypeFk, string lastInspection, string comments, bool isElectrical)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.InspectionResult_Save(inspectionResultId,InspectionFk,typeFk,resultTypeFk,lastInspection,comments,isElectrical,reader.ConectionMode);

        }

        public static void Delete(Int32 inspectionResultId)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            svc.InspectionResult_Delete(inspectionResultId,reader.ConectionMode);

        }

        public static DataSet GetInspectionResultById(Int32 inspectionResultId)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.InspectionResult_GetByInspectionResult(inspectionResultId, reader.ConectionMode);
        }

        public static DataSet GetInspectionResultByInspection(Int32 inspection)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.InspectionResult_GetByInspectionResultByInspection(inspection, reader.ConectionMode);
        }
    }
}
